package com.meida.module.bus.provider.mapper;

import com.meida.common.mybatis.base.mapper.SuperMapper;
import com.meida.module.bus.client.entity.BusMaterialSrm;
import com.meida.module.bus.client.entity.BusMaterialSrmSub;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * PMS物料计划关联SRM表 Mapper 接口
 * @author flyme
 * @date 2020-10-31
 */
@Mapper
public interface BusMaterialSrmSubMapper extends SuperMapper<BusMaterialSrmSub> {
    @Select(" select t2.* from bus_material_srm t1 INNER JOIN bus_material_srm_sub t2 on t1.busMaterialSrmId = t2.busMaterialSrmId and t1.purchaseId is not null and t1.projectId = #{projectId}")
    List<BusMaterialSrmSub> getBusMaterialSrmForWz(Long projectId);

    @Select(" select t2.* from bus_material_srm t1 INNER JOIN bus_material_srm_sub t2 on t1.busMaterialSrmId = t2.busMaterialSrmId and t1.purchaseId is null and t1.projectId = #{projectId}")
    List<BusMaterialSrmSub> getBusMaterialSrmForFb(Long projectId);
}
